@import './common/var.css';

.van-search {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 4px 15px;

  &--show-action {
    padding-right: 0;
  }

  &__input-wrap {
    position: relative;
    flex: 1;
    height: 34px;
    box-sizing: border-box;
    padding: 8px 24px 8px 35px;
    border: 1px solid $gray-light;
    border-radius: 4px;
    background-color: $white;
  }

  &__input {
    display: block;
    width: 100%;
    height: 16px;
    line-height: 16px;
    padding: 0;
    font-size: 14px;
    color: $gray-darker;
    border: none;

    &::placeholder {
      color: $gray-dark;
    }

    &::-webkit-search-decoration,
    &::-webkit-search-cancel-button,
    &::-webkit-search-results-button,
    &::-webkit-search-results-decoration {
      display: none;
    }
  }

  &__action {
    line-height: 34px;
    font-size: 14px;
    letter-spacing: 1px;
  }

  &__action-text {
    padding: 0 10px;
    color: $green;

    &:active {
      background-color: $active-color;
    }
  }

  .van-icon-search {
    color: $gray-darker;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    font-size: 16px;
  }

  .van-icon-clear {
    font-size: 14px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px; /* increase click area */
    color: $gray-dark;
  }
}
